/*
 * Edge.java
 *
 * Created on 4 de enero de 2007, 09:27 AM
 */

package shortestPath;

/**
 *
 * @author tavobula
 */
public class Edge  {
    
    /** Creates a new instance of Edge */
    private int v,w;
    private double wt;
    
    Edge(int v, int w, double wt){
        this.v=v;
        this.w=w;
        this.wt=wt;
    }
    
    public int getV(){
        return v;
    }
    
    public int getW(){
        return w;
    }
    
    public double getWt(){
        return wt;
    }
    
    public boolean from(int a){
       if((getV()==a)&&(other(a)==getW())) return true;
       return false;
    }
    
    public int other(int a){
        if(a==getV()) return getW();
        return getV();
    }
    
    public String toString(){
        String s=this.getV()+"-->"+this.getW();
        return s;
    }
    
}
